-
-
Notifications
You must be signed in to change notification settings - Fork 256
feat(multichain-account-service): add per-provider throttling for non-EVM account creation #7000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… EVM account creation
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. See these instructions for more information about preview builds. Expand for full list of packages and versions. |
ccharly
reviewed
Oct 31, 2025
packages/multichain-account-service/src/MultichainAccountWallet.ts
Outdated
Show resolved
Hide resolved
packages/multichain-account-service/src/MultichainAccountWallet.ts
Outdated
Show resolved
Hide resolved
packages/multichain-account-service/src/MultichainAccountWallet.ts
Outdated
Show resolved
Hide resolved
ccharly
reviewed
Oct 31, 2025
packages/multichain-account-service/src/MultichainAccountWallet.ts
Outdated
Show resolved
Hide resolved
ccharly
reviewed
Nov 3, 2025
packages/multichain-account-service/src/MultichainAccountWallet.test.ts
Outdated
Show resolved
Hide resolved
packages/multichain-account-service/src/MultichainAccountService.ts
Outdated
Show resolved
Hide resolved
ccharly
reviewed
Nov 3, 2025
packages/multichain-account-service/src/MultichainAccountService.ts
Outdated
Show resolved
Hide resolved
ccharly
previously approved these changes
Nov 3, 2025
Contributor
ccharly
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one 💪
ccharly
approved these changes
Nov 3, 2025
mathieuartu
added a commit
that referenced
this pull request
Nov 3, 2025
## Explanation Minor release of `@metamask/multichain-account-service`. Changelog: ```md ### Added - Add per-provider throttling for non-EVM account creation to improve performance on low-end devices ([#7000](#7000)) - Solana provider is now limited to 3 concurrent account creations by default when creating multichain account groups. - Other providers remain unthrottled by default. ``` Mobile test-drive PR: MetaMask/metamask-mobile#21905 (QA'd ✅ ) ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Publish @metamask/multichain-account-service 2.1.0 adding per-provider throttling (Solana capped at 3 concurrent) and update dependents; bump monorepo to 657.0.0. > > - **multichain-account-service (`packages/multichain-account-service`)**: > - Release `2.1.0` with per-provider throttling for non-EVM account creation. > - Solana provider limited to 3 concurrent creations by default. > - Update `CHANGELOG.md` and version references. > - **Dependents**: > - Bump `@metamask/multichain-account-service` devDependency to `^2.1.0` in `packages/account-tree-controller` and `packages/assets-controllers`. > - **Repo**: > - Bump monorepo version to `657.0.0`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b4773ca. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
juanmigdr
pushed a commit
that referenced
this pull request
Nov 3, 2025
…-EVM account creation (#7000) ## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References Related to [MUL-1222](https://consensyssoftware.atlassian.net/browse/MUL-1222), [MUL-1221](https://consensyssoftware.atlassian.net/browse/MUL-1221) ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes [MUL-1222]: https://consensyssoftware.atlassian.net/browse/MUL-1222?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Adds per-provider concurrency limits for non-EVM account creation (Solana defaults to 3), refactors creation flow to optionally await/aggregate errors, and updates providers/tests accordingly. > > - **Core** > - Introduce `withMaxConcurrency` in `SnapAccountProvider` using a semaphore; add optional `maxConcurrency` to `SnapAccountProviderConfig`. > - Add `toRejectedErrorMessage` util and factor non‑EVM creation into `MultichainAccountWallet.#createNonEvmAccounts`, supporting await-all with aggregated errors and background mode logging. > - Forward optional `providerConfigs` safely (`?.`) and allow Solana-specific config (including `maxConcurrency`). > - **Providers** > - Update `SolAccountProvider`, `BtcAccountProvider`, and `TrxAccountProvider` to use `SnapAccountProviderConfig` and throttle `createAccounts` via `withMaxConcurrency`. > - Default Solana `maxConcurrency: 3`; others unthrottled by default. > - **Tests** > - Add concurrency tests for `SnapAccountProvider`. > - Update wallet tests to verify aggregated non‑EVM failures when awaiting all and provider config forwarding. > - **Docs** > - Update `CHANGELOG.md` with new throttling behavior and defaults. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6e21486. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [MUL-1221]: https://consensyssoftware.atlassian.net/browse/MUL-1221?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
juanmigdr
pushed a commit
that referenced
this pull request
Nov 3, 2025
## Explanation Minor release of `@metamask/multichain-account-service`. Changelog: ```md ### Added - Add per-provider throttling for non-EVM account creation to improve performance on low-end devices ([#7000](#7000)) - Solana provider is now limited to 3 concurrent account creations by default when creating multichain account groups. - Other providers remain unthrottled by default. ``` Mobile test-drive PR: MetaMask/metamask-mobile#21905 (QA'd ✅ ) ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Publish @metamask/multichain-account-service 2.1.0 adding per-provider throttling (Solana capped at 3 concurrent) and update dependents; bump monorepo to 657.0.0. > > - **multichain-account-service (`packages/multichain-account-service`)**: > - Release `2.1.0` with per-provider throttling for non-EVM account creation. > - Solana provider limited to 3 concurrent creations by default. > - Update `CHANGELOG.md` and version references. > - **Dependents**: > - Bump `@metamask/multichain-account-service` devDependency to `^2.1.0` in `packages/account-tree-controller` and `packages/assets-controllers`. > - **Repo**: > - Bump monorepo version to `657.0.0`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b4773ca. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
github-merge-queue bot
pushed a commit
to MetaMask/metamask-mobile
that referenced
this pull request
Nov 4, 2025
## **Description** This PR bumps `@metamask/multichain-account-service` to `^2.1.0`, which includes performance improvements for lower end devices during account creation. Changelog: ```md - Add per-provider throttling for non-EVM account creation to improve performance on low-end devices ([#7000](MetaMask/core#7000)) - Solana provider is now limited to 3 concurrent account creations by default when creating multichain account groups. - Other providers remain unthrottled by default. ``` ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1230 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Updates `@metamask/multichain-account-service` from `^2.0.1` to `^2.1.0`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c10179c. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
github-merge-queue bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Nov 4, 2025
## **Description** This PR bumps `@metamask/multichain-account-service` to `^2.1.0`, which includes performance improvements for lower end devices during account creation. Changelog: ```md - Add per-provider throttling for non-EVM account creation to improve performance on low-end devices ([#7000](MetaMask/core#7000)) - Solana provider is now limited to 3 concurrent account creations by default when creating multichain account groups. - Other providers remain unthrottled by default. ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/37481?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1230 ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
github-merge-queue bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Nov 4, 2025
## **Description** This PR bumps `@metamask/multichain-account-service` to `^2.1.0`, which includes performance improvements for lower end devices during account creation. Changelog: ```md - Add per-provider throttling for non-EVM account creation to improve performance on low-end devices ([#7000](MetaMask/core#7000)) - Solana provider is now limited to 3 concurrent account creations by default when creating multichain account groups. - Other providers remain unthrottled by default. ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/37481?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1230 ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
github-merge-queue bot
pushed a commit
to MetaMask/metamask-extension
that referenced
this pull request
Nov 4, 2025
## **Description** This PR bumps `@metamask/multichain-account-service` to `^2.1.0`, which includes performance improvements for lower end devices during account creation. Changelog: ```md - Add per-provider throttling for non-EVM account creation to improve performance on low-end devices ([#7000](MetaMask/core#7000)) - Solana provider is now limited to 3 concurrent account creations by default when creating multichain account groups. - Other providers remain unthrottled by default. ``` [](https://codespaces.new/MetaMask/metamask-extension/pull/37481?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1230 ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation
References
Related to MUL-1222, MUL-1221
Checklist
Note
Adds per-provider concurrency limits for non-EVM account creation (Solana defaults to 3), refactors creation flow to optionally await/aggregate errors, and updates providers/tests accordingly.
withMaxConcurrencyinSnapAccountProviderusing a semaphore; add optionalmaxConcurrencytoSnapAccountProviderConfig.toRejectedErrorMessageutil and factor non‑EVM creation intoMultichainAccountWallet.#createNonEvmAccounts, supporting await-all with aggregated errors and background mode logging.providerConfigssafely (?.) and allow Solana-specific config (includingmaxConcurrency).SolAccountProvider,BtcAccountProvider, andTrxAccountProviderto useSnapAccountProviderConfigand throttlecreateAccountsviawithMaxConcurrency.maxConcurrency: 3; others unthrottled by default.SnapAccountProvider.CHANGELOG.mdwith new throttling behavior and defaults.Written by Cursor Bugbot for commit 6e21486. This will update automatically on new commits. Configure here.